﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Default.aspx.vb" Inherits="hotels.hotellist" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <asp:PlaceHolder ID="ph_SuperUsers" runat="server">
    
    some content to go here
    
    </asp:PlaceHolder>
  
        <asp:SqlDataSource ID="tagsDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:hotelsConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:hotelsConnectionString.ProviderName %>" 
            SelectCommand="SELECT [Tag] FROM [Tags] ORDER BY [Tag]"></asp:SqlDataSource>

    <p>
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="tagsDataSource">
        <ItemTemplate>
        
        <a href="Default.aspx?Tag=<%# Eval("Tag")%>"><%# Eval("Tag")%> </a>
        
        </ItemTemplate>
        </asp:Repeater>
        <a href="Default.aspx">All</a>
    <br />
</p>
<p>
    &nbsp;</p>
    <p>
        <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="HotelName" HeaderText="HotelName" 
                    SortExpression="HotelName" />
                <asp:BoundField DataField="Location" HeaderText="Location" 
                    SortExpression="Location" />
                <asp:BoundField DataField="Description" HeaderText="Description" 
                    SortExpression="Description" />
                <asp:BoundField DataField="ContactDetails" HeaderText="ContactDetails" 
                    SortExpression="ContactDetails" />
                <asp:TemplateField HeaderText="Rating">
                <ItemTemplate> <%# getStars(Eval("Stars"))%></ItemTemplate>
                </asp:TemplateField>
                <asp:HyperLinkField DataNavigateUrlFields="HotelUrl" 
                    DataNavigateUrlFormatString="{0}" Text="Hotel Website" />
                <asp:TemplateField>
                <ItemTemplate>
                <a href="hotelInformation.aspx?ID=<%#Eval("ID") %>"><img src="<%#Eval("Picture")%>" style="width:100px;height:100px" /></a>
                </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:hotelsConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:hotelsConnectionString.ProviderName %>" CancelSelectOnNullParameter="False" 
            
            >
            <SelectParameters>
                <asp:QueryStringParameter Name="Tag" QueryStringField="Tag" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
</p>
<p>
</p>
<p>
</p>
<p>
</p>

</asp:Content>
